import axios from '@/libs/api.request'

export const login = ({ userName, userPwd }) => {
    return axios.request({
        url: '/admin/login',
        data: {
            userName,
            userPwd
        },
        method: 'post'
    })
}

export function logout (token) {
    return axios.request({
        url: '/admin/loginOut',
        method: 'post',
        headers: {
            Authorization: token
        }
    })
}

export function modifyPassword (data) {
    return axios.request({
        url: '/admin/updatePwd',
        data,
        method: 'post'
    })
}

export function resetPwd (id) {
    return axios.request({
        url: '/admin/resetPwd',
        params: {
            id
        },
        method: 'get'
    })
}
